import React,{useEffect} from 'react'
import './index.scss'
import T from 'prop-types'
import icon from './icon_default_user.png'
import Point from '../../../components/point'
import axios from '../../../utils/axios'

export default function FriendList(props) {
  const { username, imgSrc = icon, toDetail,number=null } = props
  useEffect(()=>{
    // getList()
  },[])

  return (
    <>
      <div className="friend-item" onClick={toDetail}>
        <img src={imgSrc} alt="发生了错误" className="avatar" />
        {username}
        { number?  <Point num={number}></Point>:''}   
      </div>
    </>
  )
}

FriendList.propTypes = {
  username: T.string,
  imgSrc: T.string,
  toDetail: T.func,
  number: T.number
}
